package com.dliu.javadesign.structure.flyweight;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author yanglei
 * date 2021/3/31 19:12
 */
@Data
@Accessors(chain = true)
public class Activity {
    private Long id;
    private String name;
    private String desc;
    private String date;
    private Stock stock;
}

@Data
@Accessors(chain = true)
class Stock {
    private Integer total;
    private Integer used;

    Stock addUsed(Integer used){
        this.used += used;
        return this;
    }
}
